<div class="info">
<h1 class="font_h1">Cập nhật hình ảnh</h1>
<?php if(isset($error))  : ?>
<h2 class="error_red"><?php echo $error;?></h2>
<?php endif;?>
<form id="frm_add" action="<?php echo base_url().'admin/photo/edit_photo/'.@$uid?>" method="POST" enctype="multipart/form-data">
<table class="table1">
    <tr>
                <td width="20%">Tên hình ảnh</td>
                <td width="80%">
                	<?php if(@$photo->name_photo!='') {?>
                    <input type="text" name="txt_title" style="width:400px" value="<?=@$photo->name_photo;?>" />
                    <?php } else { ?>
                    <input type="text" name="txt_title" style="width:400px" value="<?php set_value('txt_title');?>"  />
                    <?php } ?>
                </td>
    </tr>   
    <tr>
                <td width="20%"></td>
                <td width="80%">
                	<span style="background: red;width:200px"><?php echo form_error('txt_title');?></span>
                </td>
    </tr>  
    <tr>
                <td width="20%">Hình ảnh</td>
                <td width="80%">
                	<img src="<?php echo base_url().@$photo->image;?>" /><br />
                    <input type="hidden" name="image" value="<?php echo @$photo->image;?>" />                    
                    <input type="file" name="p_image" />
                </td>
    </tr>    
     <tr>
                <td width="20%">Album</td>
                <td width="80%">
                	<select name="txt_id_cats">  
                        <?php foreach($cats as $row):?>
                            <?php if($row->id_album_cats == $photo->id_cats) :?>
                        <option value="<?php echo $row->id_album_cats?>" selected="selected"><?php echo $row->title_cats;?></option>
                            <?php else : ?>
                        <option value="<?php echo $row->id_album_cats?>"><?php echo $row->title_cats;?></option>    
                            <?php endif; ?>
                        <?php endforeach; ?>
                    </select>
                </td>
    </tr>
    <tr>
                <td width="20%">Thứ tự</td>
                <td width="80%">
                	<?php if(@$photo->order_photo!='') {?>
                    <input type="text" name="txt_order" style="width:20px" value="<?=@$photo->order_photo;?>" />
                    <?php } else { ?>
                    <input type="text" name="txt_order" style="width:20px"  />
                    <?php } ?>
                </td>
    </tr>
     <tr>
                <td width="20%">Actvie/No active</td>
                <td width="80%">
                
                <input type="checkbox" name="txt_active" value="1" <?php if(@$photo->active == '1') echo "checked"?>/>
                   
                </td>
    </tr> 
   
   
    <tr>
                <td width="20%"></td>
                <td width="80%">
                	<a  class="button" onclick="$('#frm_add').submit()" href="javascript:void(0)">Lưu lại</a>
                 <a  class="button" href="<?php echo base_url().'admin/photo/list_photo'?>">Quay lại</a>
                </td>
    </tr>
</table>
</form>
</div>
               